#pragma once
#include "bp/bp_platform.h"

void * _BP_API bp_alloc_zero(size_t count, size_t sz);
void * _BP_API bp_alloc(size_t count, size_t sz);
void _BP_API bp_free(void *p);

#define BP_ALLOC_STRUCT_ZERO(t) (t *)bp_alloc_zero(1, sizeof(t))
#define BP_ALLOC_ARRAY_ZERO(count, t) (t *)bp_alloc_zero(count, sizeof(t))
#define BP_FREE_SET_NULL(p) bp_free((p)); p = NULL

//uint32_t _BP_API _bp_dword_be2le(uint32_t be);